From 9192e6c7747fd2d3f6a6c5c07d886a0982b53f11 Mon Sep 17 00:00:00 2001
From: polwex <polwex@sortug.com>
Date: Wed, 21 May 2025 15:28:03 +0700
Subject: good tandem good tandem of ideas and implementation

---
 src/pages/lesson/[slug].tsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/pages/lesson/[slug].tsx')

diff --git a/src/pages/lesson/[slug].tsx b/src/pages/lesson/[slug].tsx
index 6632838..9e6e6cc 100644
--- a/src/pages/lesson/[slug].tsx
+++ b/src/pages/lesson/[slug].tsx
@@ -8,6 +8,8 @@ import type { PageProps } from "waku/router";
 import db from "@/lib/db";
 import { useCookies } from "@/lib/server/cookiebridge";
 import Deck from "@/components/Flashcard/Deck";
+import Deck2 from "@/components/Flashcard/Deck2";
+import { CardFront, CardBack } from "@/components/Flashcard/ServerCard";
 
 const flags: Record<string, string> = {
   th: "🇹🇭",
@@ -34,12 +36,17 @@ export default async function HomePage(props: PageProps<"/lesson/[slug]">) {
   const data = await getData(Number(props.slug), user.id);
   if ("error" in data) return <p>Error</p>;
   // console.log({ data });
+  const cardComponents = data.ok.cards.map((card) => ({
+    id: card.id,
+    front: <CardFront data={card} />,
+    back: <CardBack data={card} />,
+  }));
 
   return (
     <>
       <section>
         <h2 className="text-lg">Thai!</h2>
-        <Deck data={data.ok} />
+        <Deck2 data={data.ok} cards={cardComponents} />
       </section>
     </>
   );
-- 
cgit v1.2.3

